<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Demo</title>
    <link href="//unpkg.com/layui@2.9.0/dist/css/layui.css" rel="stylesheet">
</head>
<body>
<style>
    .demo-reg-container{ width: 420px; margin: 21px auto 0;}
</style>
<form action="insert" class="layui-form" method="post" >
    <div class="demo-reg-container">
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-username"></i>
                </div>
                <input type="text" name="theme" value="" lay-verify="required" placeholder="theme" autocomplete="off" class="layui-input" lay-affix="clear">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <input type="text" name="description" value="" lay-verify="required" placeholder="description" autocomplete="off" class="layui-input" lay-affix="clear">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <input type="text" name="asinger" value="" lay-verify="required" placeholder="asinger" autocomplete="off" class="layui-input" lay-affix="clear">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <input type="text" name="bsinger" value="" lay-verify="required" placeholder="bsinger" autocomplete="off" class="layui-input" lay-affix="clear">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">日期时间选择器</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" name="endtime" id="ID-laydate-type-datetime-1" placeholder="yyyy-MM-dd HH:mm:ss">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-reg">录入</button>
        </div>
    </div>
</form>
<script src="//unpkg.com/layui@2.9.0/dist/layui.js"></script>
<script>
    layui.use(function(){
        //data:事件处理
        var laydate = layui.laydate;
        // 渲染
        laydate.render({
            elem: '#ID-laydate-demo'
        });
        // 渲染
        laydate.render({
            elem: '#ID-laydate-type-datetime-1',
            type: 'datetime',
            fullPanel: true // 2.8+
        });
        var form = layui.form;
        var layer = layui.layer;
        // radio 事件
        form.on('radio(demo-radio-filter)', function(data){
            var elem = data.elem; // 获得 radio 原始 DOM 对象
            var checked = elem.checked; // 获得 radio 选中状态
            var value = elem.value; // 获得 radio 值
            var othis = data.othis; // 获得 radio 元素被替换后的 jQuery 对象

            layer.msg(['value: '+ value, 'checked: '+ checked].join('<br>'));
        });
        // 通过表单提交事件，演示 radio 不同状态下的字段结果
    });
</script>
</body>
</html>